package notebook;

import java.util.ArrayList;

class Value {
    private int i = 0;
    private int j = 1;

    @Override
    public String toString() {
        return "Value{" +
                "i=" + i +
                ", j=" + j +
                '}';
    }
}

public class NoteBook {
    private ArrayList<String> notes = new ArrayList<>();
    public void add(String s) {
        notes.add(s);
    }
    public void add(String s, int index) {
        notes.add(index, s);
    }
    public int getSize() {
        return notes.size();
    }
    public String getNote(int index) {
        return notes.get(index);
    }
    public void removeNote(int index) {
        notes.remove(index);
    }
    public String[] list() {
        String[] tmp = new String[notes.size()];
        notes.toArray(tmp);
        return tmp;
    }
    public static void main(String[] args) {

        NoteBook nb = new NoteBook();
        nb.add("first");
        nb.add("second");
        System.out.println("nb.getSize() = " + nb.getSize());
        System.out.println("nb.getNote(0) = " + nb.getNote(0));
        String[] a = nb.list();
        for (String s : a) {
            System.out.println("s = " + s);
        }

        Value v = new Value();
        System.out.println(v);
    }
}
